#include"Dateh.h"
Date& Date:: operator+=(int day)
{
	if (day < 0)
	{
		return *this -= -day;
	}
	_day += day;
	while (_day > GetMonthDay(_year, _month))
	{
		_day -= GetMonthDay(_year, _month);
		_month++;
		if (_month > 12)
		{
			_year++;
			_month = 1;
		}
	}
	return *this;
}
Date& Date:: operator-=(int day)
{
	if (day < 0)
	{
		return *this += -day;
	}
	_day -= day;
	while (_day <= 0)
	{
		_month--;
		if (_month < 1) 
		{
			_year--;
			_month = 12;
		}
		_day += GetMonthDay(_year, _month);
	}
	return *this;
}
Date Date:: operator-(int day) const
{
	Date tmp = *this;
	tmp += day;
	return tmp;
}
Date Date:: operator+(int day) const
{
	Date tmp = *this;
	tmp -= day;
	return tmp;
}
int Date:: operator-(const Date& d)
{
	Date min = *this;
	Date max = d;
	int falg = 1;
	
}
